home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / System Utilities / MacGS 2.5.2ß3 Runtime ƒ / gs / system / gs_mac.ps < prev    next >
Encoding:
Text File  |  1993-06-01  |  1.9 KB  |  99 lines  |  [TEXT/KAHL]

  1. %!
  2.  
  3.  
  4. /strcat            %    string1 string2  ->  newString
  5. {
  6.     dup length 3 -1 roll dup length        % s2 l2 s1 l1
  7.     dup 4 -1 roll add string dup        % s2 s1 l1 ns ns
  8.     4 -1 roll 0 exch putinterval        % s2 l1 ns
  9.     dup 4 1 roll exch 3 -1 roll            % ns ns l1 s2
  10.     putinterval                            % ns
  11. } def
  12.  
  13.  
  14. % Check the Mac GUI revision.
  15.  
  16. 2523
  17. dup .macGSversion ne
  18. {
  19.     (MacGS GUI revision \() .macGSversion 10 string cvs strcat
  20.     (\) does not match gs_mac.ps revision \() strcat exch 10 string cvs strcat
  21.     (\).) strcat .macalert pop
  22.     1 .quit
  23. } if pop
  24.  
  25.  
  26. /.macshowpage where
  27.     {
  28.         pop
  29.     }
  30.     {
  31.         /.macshowpage /showpage load def        %    original definition
  32.  
  33.         /.domacshowpage    0 def                    %    use original or spoof
  34.  
  35.         /showpage                                %    Mac showpage
  36.         {
  37.             [
  38.                 %    case 0
  39.                 {
  40.                     .macshowpage    %    use original showpage (non-Mac device driver)
  41.                 }
  42.                 %    case 1
  43.                 {
  44.                     #copies true .outputpage
  45.                     (>>> showpage, select Resume from MacGS menu to continue <<<\n)
  46.                     print flush
  47.                     .macconfirm erasepage initgraphics not {stop} if
  48.                 }
  49.                 %    case 2
  50.                 {
  51.                     #copies true .outputpage erasepage initgraphics
  52.                     %    do not pause for automatic printing
  53.                 }
  54.             ]
  55.             .domacshowpage get exec
  56.         } def
  57.  
  58.     } ifelse
  59.  
  60.  
  61. /.macrunfile
  62. {
  63.     .macopenfile
  64.     {
  65.         userdict /.macRunFile 3 -1 roll put
  66.  
  67.         count array astore userdict /.macOperStack 3 -1 roll store        %    save operands
  68.         userdict /.macDictStack countdictstack array dictstack store    %    save dicts
  69.  
  70.         erasepage gsave userdict /.macRunFile get cvx execute grestore initgraphics
  71.  
  72.         clear userdict /.macOperStack get aload pop        %    restore operand stack
  73.  
  74.         countdictstack 3 sub 0 1 3 -1 roll                %    close non-standard dicts
  75.         {
  76.             pop end
  77.         } for
  78.  
  79.         2 1 userdict /.macDictStack get length 1 sub    %    re-open non-standard dicts
  80.         {
  81.             userdict /.macDictStack get get begin
  82.         } for
  83.     } if
  84. } def
  85.  
  86.  
  87. /.maclaserprep
  88. {
  89.     {(laserprep_68.pro) run} execute
  90. } def
  91.  
  92.  
  93. /.macsetdevice
  94. {
  95.     getdevice
  96.     dup devicename (...Using device “) print print (”...\n) print flush
  97.     setdevice
  98. } def
  99.